package jude.java.money.beans;

import java.util.Date;

public class FtpSite extends Ftp {

	private static final long serialVersionUID = -6090160023360088715L;
	
	private Date insertTime;
	private Date updateTime;
	private Date lastUpdatedTime;
	
	private int updateTimes;	//尝试加黑链次数
	private int updated;		//更新黑链次数
	private int fileCount;		//黑的文件数
	
	private int loginTimes;		//登录次数(尝试登录)
	private int logined;		//登录成功次数
	
	private boolean ignored;
	private String group;
	
	private String trojan;		//木马路径
	private String remark;		//备注
	private String error;
	
	private int pr = -3;		//not setted
//	private boolean handled;
	
	
	public FtpSite() {
	}
	
	public FtpSite(String host, String usr, String pwd) {
		super(host, usr, pwd);
		this.insertTime = new Date();
		this.updateTime = this.insertTime;
	}
	
	public Date getInsertTime() {
		return insertTime;
	}
	public void setInsertTime(Date insertTime) {
		this.insertTime = insertTime;
	}
	public Date getUpdateTime() {
		return updateTime;
	}
	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}
	public int getLogined() {
		return logined;
	}
	public void setLogined(int logined) {
		this.logined = logined;
	}
	
	public int getUpdated() {
		return updated;
	}

	public void setUpdated(int updated) {
		this.updated = updated;
	}

	public String getTrojan() {
		return trojan;
	}

	public void setTrojan(String trojan) {
		this.trojan = trojan;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public int getUpdateTimes() {
		return updateTimes;
	}

	public void setUpdateTimes(int updateTimes) {
		this.updateTimes = updateTimes;
	}

	public int getLoginTimes() {
		return loginTimes;
	}

	public void setLoginTimes(int loginTimes) {
		this.loginTimes = loginTimes;
	}
	
	public void setLastUpdatedTime(Date lastUpdatedTime) {
		this.lastUpdatedTime = lastUpdatedTime;
	}
	
	public Date getLastUpdatedTime() {
		return lastUpdatedTime;
	}
	
	public void setIgnored(boolean ignore) {
		this.ignored = ignore;
	}
	
	public boolean isIgnored() {
		return ignored;
	}
	
	public void setGroup(String group) {
		this.group = group;
	}
	
	public String getGroup() {
		return group;
	}
	
	public void setFileCount(int fileCount) {
		this.fileCount = fileCount;
	}
	
	public int getFileCount() {
		return fileCount;
	}
		
	public String getError() {
		return error;
	}
	
	public void setError(String error) {
		this.error = error;
	}
	
	public int getPr() {
		return pr;
	}
	
	public void setPr(int pr) {
		this.pr = pr;
	}

	/////////////////////////////////////////////////////////////////
	
	public void init(String host, String usr, String pwd) {
		super.init(host, usr, pwd);
		if (insertTime == null) {
			insertTime = new Date();
		}
	}
	
	public void tryLogin(boolean reset) {
		if (reset) {
			loginTimes = 1;
			logined = 0;
		} else {
			loginTimes ++;
		}
	}
	
	public void onLogined() {
		logined ++;
	}
	
	public void tryUpdate() {
		updateTimes ++;
		updateTime = new Date();
//		fileCount = 0;
	}
	
	public void onUpdated() {
		updated ++;
		lastUpdatedTime = new Date();
	}
}
